﻿@model DatNuocViet.Models.Tour
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    string lang = (Session["Language"] == null) ? "vi" : Session["Language"].ToString();
    string url = HttpContext.Current.Request.Url.AbsoluteUri;
}
@helper FormatDatime(DateTime? date)
    {
        DateTime result = (DateTime)date;
    
    @result.ToString("dd-MM-yyyy")
}
@section tourArea1
{
    <div style="border: 1px solid #F1EEEB">
        <h2 class="subtitle">
            <a href="@Url.Action("index", "tours", new { id = ViewBag.toursTypeId })" >@ViewBag.ToursType</a>
        </h2>
        <div style="padding: 0 12px 12px 12px">
            <div id="social_nav_horizontal">
                <ul>
                    <li style="margin: 0px !important"><a class="delicious" href="http://del.icio.us/post?url=@url" title="Bookmark on del.icio.us">
                        Delicious</a></li>
                    <li><a class="facebook" href="http://www.facebook.com/sharer.php?u=@url"  title="Share this on Facebook" >
                        Facebook</a></li>
                    <li><a class="stumbleupon" href="http://www.stumbleupon.com/submit? url=@url" title="Stumble This Page" >
                        Stumble</a></li>
                    <li><a class="twitter" href="http://twitter.com/home?status=@url" title="Tweet This Page" >
                        Twitter</a></li>
                </ul>
            </div>
            <div style="clear: both">
            </div>
            <div style="margin: 15px 0px 15px 0px">@FormatDatime(Model.CreateOn)</div>
            <div class="Title-detailNews">
                @if (lang == "en")
                { @Html.Raw(Model.NameEn);
                }
                else
                { @Html.Raw(Model.NameVn);
                }</div>
            <div style="color: #000000; line-height: 20px !important;">
                @if (lang == "en")
                { @Html.Raw(Model.DetailsEn);
                }
                else
                { @Html.Raw(Model.DetailsVn);
                }
            </div>
            <div class="tours_detail_info dattour_form" id="dattour">
            <form id="frmdattour" name="frmdattour" method="post" action="@Url.Action("booking","tours")">
           	  <table width="100%" border="0" cellspacing="1" cellpadding="5">
              		<tbody><tr>
                    <td colspan="2"><h2>Đặt tour: @Model.NameVn</h2>
                    <input type="hidden" name="tourname" id"tourname" value="@Model.NameVn" />
                    </td>
                  </tr>
                  <tr>
                    <td colspan="2" bgcolor="#EAC600"><strong>Ghi chú:</strong> Các điều khoản qui định về giá cho từng đối tượng khách, phụ thu (thuế, phụ thu thêm, bảo hiểm , . . . ) cụ thể cho chuyến tour xin vui lòng liên lạc với chúng tôi để có thông tin chính xác nhất</td>
                  </tr>
                  <tr>
                    <td align="right"><p style="text-align:right!important"><strong>Họ và tên:</strong></p></td>
                    <td><input type="text" class="required" name="hoten" id="textfield2" style="opacity: 1;" /> 
                      </td>
                  </tr>
                  <tr>
                    <td align="right"><p style="text-align:right!important"><strong>Địa chỉ:</strong></p></td>
                    <td><input class="required" type="text" name="diachi" id="textfield3" style="opacity: 1;" /> 
                      </td>
                  </tr>
                  <tr>
                    <td align="right"><p style="text-align:right!important"><strong>Số điện thoại:</strong></p></td>
                    <td><input class="required number" type="text" name="dienthoai" id="textfield4" style="opacity: 1;" /> 
                      </td>
                  </tr>
                  <tr>
                    <td align="right"><p style="text-align:right!important"><strong>E-mail:</strong></p></td>
                    <td><input type="text" class="required email" name="email" id="textfield5" style="opacity: 1;" /> 
                      </td>
                  </tr>
                  <tr>
                    <td align="right" valign="top"><p style="text-align:right!important"><strong>Ghi chú:</strong></p></td>
                    <td><textarea name="ghichu" id="textarea" cols="45" rows="5"></textarea></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td><input name="submitButtonId" id="submitButtonId" type="submit" class="send_btn" value="Đặt tour" style="opacity: 1;"/></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
              </tbody></table>
              </form>
              <script  type="text/javascript">
               $(window).load(function () {
                  $("#submitButtonId").click(function () {

                      var url = '@Url.Action("booking","tours")'; // the script where you handle the form input.

                      $.ajax({
                          type: "POST",
                          url: url,
                          data: $("#frmdattour").serialize(), // serializes the form's elements.
                          success: function (data) {
                              if(data == "True")
                              {
                                alert("tour đã được đặt"); // show response from the php script.
                              }
                          }
                      });

                      return false; // avoid to execute the actual submit of the form.
                  });
                });
              </script>
            </div>
        </div>
    </div>
    @*tin lien quan*@
    <div style="margin-top:10px;">
        @foreach (var item in (List<DatNuocViet.Models.SearchTourResult>)ViewData["RelateTours"])
        {
            <a href="@Url.Action("Details", "Tours", new { id = item.TourId })"
                        title="@if (lang == "en")
                               { @Html.Raw(item.NameEn);
                               }
                               else
                               { @Html.Raw(item.NameVn);
                               }">
                @if (lang == "en")
                { @Html.Raw(item.NameEn);
                }
                else
                { @Html.Raw(item.NameVn);
                }</a>
            <br />
        }
    </div>
    @*end*@
}
